package com.gitee.swsk33.springannotationbased;

import com.gitee.swsk33.logcoredemo.service.LogService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;

@ComponentScan
public class Main {

	public static void main(String[] args) {
		// 创建IoC容器，基于注解的
		ApplicationContext context = new AnnotationConfigApplicationContext(Main.class);
		// 从容器中取出日志服务对象并调用
		LogService logService = context.getBean(LogService.class);
		logService.info("调用日志服务！");
		logService.warn("调用日志服务！");
	}

}